//
//  ZH_EvaluationGoodApplyTableViewCell.m
//  ChangeMerchants
//
//  Created by zhangliwen on 2018/10/10.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_EvaluationGoodApplyTableViewCell.h"
@interface ZH_EvaluationGoodApplyTableViewCell()
@property (nonatomic,weak)UIView *lineView;
@property (nonatomic,weak)UILabel *titleLabel;
@property (nonatomic,weak)UILabel *contentLabel;
@end
@implementation ZH_EvaluationGoodApplyTableViewCell

+ (instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_EvaluationGoodApplyTableViewCell";
    ZH_EvaluationGoodApplyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_EvaluationGoodApplyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}

///初始化
-(void)initDefault
{
    [self unShowClickEffect];
//    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(9));
        make.left.equalTo(self.contentView).offset(FITSCALE(22));
        make.height.mas_equalTo(FITSCALE(17));
        make.width.mas_equalTo(FITSCALE(2));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lineView).offset(FITSCALE(2));
        make.left.equalTo(self.lineView.mas_right).offset(FITSCALE(6));
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lineView).offset(FITSCALE(2));
        make.left.equalTo(self.titleLabel.mas_right).offset(FITSCALE(2));
        make.right.equalTo(self.contentView).offset(FITSCALE(-22));
        make.bottom.equalTo(self.contentView).offset(FITSCALE(-5));;
    }];
}
- (void)updataUI:(NSDictionary *)data{
    if (data) {
        self.titleLabel.text = [NSString stringWithFormat:@"%@",data[@"nickname"]];
        self.contentLabel.text = [NSString stringWithFormat:@"%@",data[@"msg"]];
    }
}
#pragma mark - gettter,setter
- (UIView *)lineView{
    if (!_lineView) {
        UIView *view = [UIView createViewWithBackgroundColor:[UIColor colorWithHexString:@"#00C9AE"]];
        [self.contentView addSubview:_lineView = view];
    }
    return _lineView;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [UILabel createLabelWithText:@"商家名称:" font:kFontSize_26];
        label.textColor = [UIColor colorWithHexString:@"#00C9AE"];
        [self.contentView addSubview:_titleLabel = label];
    }
    return _titleLabel;
}
- (UILabel *)contentLabel{
    if (!_contentLabel) {
        UILabel *label = [UILabel createLabelWithText:@"感谢您的购买!" font:kFontSize_26];
        [label lableAutoLinefeed];
        [self.contentView addSubview:_contentLabel = label];
    }
    return _contentLabel;
}
@end
